#include <iostream>
#include <conio.h>

using namespace std;

class romb{
	int dim;
public:
	romb()
	{
		this->dim=1;
	}
	romb(int dim)
	{
		this->dim=dim;
	}
	friend ostream& operator<<(ostream&, romb&);
};

class dreptunghi
{
	int lungime,latime;
public:
	dreptunghi()
	{
		this->lungime=2;
		this->latime=1;
	}
	dreptunghi(int L,int l)
	{
		this->lungime=L;
		this->latime=l;
	}
	friend ostream& operator<<(ostream&, dreptunghi&);
};

	ostream& operator<<(ostream& o, dreptunghi& nr)
	{
		
		int i,j;
		o<<' ';
		for(i=0;i<nr.lungime;++i)
			o<<'_';
		o<<endl;
		for(i=0;i<nr.latime;++i)
		{
			o<<'|';
			for(j=0;j<nr.lungime;++j)
			{
				if(i==nr.latime-1)
					o<<'_';
				else o<<' ';
			}
			o<<'|';
			o<<endl;
		}
		return o;
	}

ostream& operator<<(ostream& o, romb& rb)
{
	int i,j;
	if(rb.dim!=0)
	{
		for(i=0;i<rb.dim;++i)
		{
			for(j=0;j<rb.dim-i-1;++j)
				o<<' ';
			o<<'/';
			for(j=0;j<i*2;++j)
				o<<' ';
			o<<'\\';
			o<<endl;
		}
		for(i=rb.dim-1;i>=0;--i)
		{
			for(j=0;j<rb.dim-i-1;++j)
				o<<' ';
			o<<'\\';
			for(j=0;j<(i)*2;++j)
				o<<' ';
			o<<'/';
			o<<endl;
		}
	}
	return o;
}

int main()
{
	romb r1;
	romb r2(2);
	romb r3(3);
	romb r4(10);
	dreptunghi d1;
	dreptunghi d2(4,2);
	cout<<r1;
	cout<<r2;
	cout<<r3;
	cout<<r4;
	cout<<d1;
	cout<<d2;
	_getch();
	return 0;
}